<script setup lang="ts">
// 跳出layout部署显示整个页面
definePageMeta({
  layout: false,
})
// 获取nuxt配置信息
const config = useRuntimeConfig()

// 获取当前路由信息
const route = useRoute()

//内容信息
let detail = ref({})

// 获取当前栏目id
let id = ref<number>()
id.value = route.params.id;

// 请求数据
const { data, pending, error, refresh } = await useFetch(config.public.baseURL + '/art/detail', {
    method: 'GET',
    query: {
        // 我的待办事项数据
        id: id.value
    }
})
detail.value = data.value.data[0]

</script>

<template>
    <div class="title">{{ detail.name }}</div>
    <div class="time">
        更新时间：{{ detail.createtime }}
    </div>
    <div v-html="detail.content"></div>
</template>

<style scoped lang="scss">
.title{
    text-align: center;
    font-size: 36px;
    padding-top: 30px;
    box-sizing: border-box;
}
.time{
    color: #999;
    padding: 20px 0;
    box-sizing: border-box;
}
</style>